package com.training1.api.controller;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.training1.core.dto.APIResultDto;
import com.training1.core.entity.NodeAccountEntity;
import com.training1.core.modules.service.JournalListService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;

@Api(value = "/api/journal", description = "获取会员对账单列表") // Swagger annotation
@RestController
@RequestMapping("/api/journal")
public class APIJournalListController {
	
	private static final Logger logger = LoggerFactory.getLogger(APIJournalListController.class);
	
	@Resource
	private JournalListService journalListService;
	
	@ApiOperation(value = "api获取会员对账单列表, 参数是会员手机号码")
	@RequestMapping(value = "/appJournalList", method = RequestMethod.GET)
	public APIResultDto<Object> login(@RequestParam String cellPhone){
		logger.info("获取会员对账单列表, cellphone : " + cellPhone);
		APIResultDto<Object> dto = new APIResultDto<Object>();
		List<NodeAccountEntity> nodeAccountList = 
				journalListService.findJournalList(cellPhone);
		dto.setData(nodeAccountList);
		return dto;
	}

}
